/************************************************************************

								Heroes IV
					  Copyright 2000, The 3DO Company

	------------------------------------------------------------------
  						       town_type_set.cpp

	$Header:  $

	$NoKeywords: $

 ************************************************************************/

// kill the 255+ character identifier warning.  Templates tend to exceed that easily.
#include "precompiled.h"
#pragma warning( disable: 4786 )

#include "town_type_set.h"

#include "bitset_io.h"

namespace
{
	int const k_current_version = 0;
}

// ------------------------------------------------------------
// read skill set
// ------------------------------------------------------------
bool t_town_type_set::read( std::streambuf& stream )
{
	t_uint8 version = get< t_uint8 >( stream );

	if ( version > k_current_version )
		return false;

	*this = get_bitset< k_town_type_count >( stream );

	return true;
}

// ------------------------------------------------------------
// write skill set
// ------------------------------------------------------------
bool t_town_type_set::write( std::streambuf& stream ) const
{
	put<t_uint8>( stream, k_current_version );
	put_bitset< k_town_type_count >( stream, *this );
	return true;
}
